package com.example.pool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadPoolDemo1 {

	public static void main(String[] args) {
		ExecutorService threadPool1 = Executors.newFixedThreadPool(5);
		Executors.newCachedThreadPool();
		
		for (int i = 1; i < 10; i++) {
			threadPool1.execute(() -> {
				System.out.println(Thread.currentThread().getName() + "办理业务");
			});
		}
		
		threadPool1.shutdown();
	}
}
